// 获取小程序实例
const app = getApp()

Page({
  data: {
    msg: 'hello weapp',
    isShowMsg: true,
    className: 'red',
    type: 'A',
    list: [
      'hello',
      'weapp',
      '买西瓜',
      '瓜皮子是金做的',
    ]
  },
  toggleMsg() {
    this.setData({
      isShowMsg: !this.data.isShowMsg
    })

    console.log(this.data.isShowMsg)
  },
  onLoad() {
    console.log('page onload===============')
    // console.log('===============')
    // app.http()
    // console.log(app.globalData)
    console.log(getCurrentPages())
  },
  onShow() {
    console.log('page onshow===============')
  },
  onHide() {
    console.log('page onHide===============')
  },
  onReady() {
    console.log('page onReady===============')
  },
  onPullDownRefresh() {
    console.log('Refresh')
  },
  onReachBottom() {
    console.log('onReachBottom')
  },
  onShareAppMessage() {
    return {
      title: '我是分享自定义的title',
      path: '',
      imageUrl: 'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png'
    }
  },
  onPageScroll({scrollTop}) {
    console.log(scrollTop)
  },
  handleClick()  {
    this.setData({
      msg: 'click'
    })
  },
  toAbout() {
    /*
    wx.navigateTo({
      url: '/pages/about/show'
    })*/

    this.router.navigateTo({
      url: '../about/show'
    })
  }
})
